package com.aiyige.model.request;

import com.aiyige.base.api.ApiManager;
import com.aiyige.model.CustomerRequestModel;

import okhttp3.ResponseBody;
import retrofit2.Call;

/**
 * 客户基本信息编辑
 * Created by xiachao
 */

public class CustomerInfoUpdateRequest {
    String id;
    CustomerRequestModel customer;

    private CustomerInfoUpdateRequest(Builder builder) {
        setId(builder.id);
        setCustomer(builder.customer);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public String getId() {
        return id == null ? "" : id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public CustomerRequestModel getCustomer() {
        return customer;
    }

    public void setCustomer(CustomerRequestModel customer) {
        this.customer = customer;
    }

    public static final class Builder {
        private String id;
        private CustomerRequestModel customer;

        private Builder() {
        }

        public Builder id(String id) {
            this.id = id;
            return this;
        }

        public Builder customer(CustomerRequestModel customer) {
            this.customer = customer;
            return this;
        }

        public Call<ResponseBody> build() {
            return ApiManager.getService().customerPatch(id,customer);
        }
    }
}
